package com.teddy.view.tree;

import com.hp.hpl.jena.rdf.model.Resource;

public class ResourceTreeItem {
	private String label;
	private Resource res;

/*	public ResourceTreeItem(TreeItem modelTreeItem, int style) {
		super(modelTreeItem, style);
	}
	
	public ResourceTreeItem(TreeItem modelTreeItem, int style, Resource res) {
		super(modelTreeItem, style);
		this.res = (Resource) res;
		setText();
		setItemCount(1);
	}
	
	public ResourceTreeItem(TreeItem modelTreeItem, int style, Resource res, String lang) {
		treeItem.super(modelTreeItem, style);
		this.res = (Resource) res;
		setSelectedLanguage(lang);
		setText();
		treeItem.setItemCount(1);
	}
	
	public void setText(){
		StmtIterator it =  res.listProperties(SKOS.prefLabel);
		while(it.hasNext()){
			Statement s = it.next();
			if(getSelectedLanguage()!= null){
				treeItem.isetText(s.getString());
				if (s.getLanguage().equals(getSelectedLanguage()))
					break;
			}
			else{
				treeItem.setText(s.getString());
				break;
			}
		}
	}

	@Override
	public void expand() {
		// TODO Auto-generated method stub
		treeItem.removeAll();
		StmtIterator it = res.listProperties(SKOS.narrower);
		while(it.hasNext()){
			Statement s = it.next();
			ResourceTreeItem item = new ResourceTreeItem(treeItem, SWT.NONE,s.getResource(), getSelectedLanguage());
		}
	}

	@Override
	public void refresh() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void remove() {
		res.getModel().remove(res.listProperties());
	}

	@Override
	public void rename() {
		// TODO Auto-generated method stub
		
	}

	public String getPrefLAbel(){
		return getLabel();
	}
	
	public void setPrefLAbel(String label){
		setLabel(label);
		
	}
	public void setLabel(String label) {
		this.label = label;
	}

	public String getLabel() {
		return label;
	}
*/
}
